package com.csjbot.weedle_auto.util

import java.io.UnsupportedEncodingException
import java.util.*

/**
 * Created by chenqi on 8/10/17.
 * 汉字处理工具
 */

object CharactersUtil {
    /**
     * 生成随机汉子
     * @return
     */
    val randomChar: Char
        get() {
            var str = ""
            val hightPos: Int
            val lowPos: Int
            val random = Random()
            hightPos = 176 + Math.abs(random.nextInt(39))
            lowPos = 161 + Math.abs(random.nextInt(93))

            val b = ByteArray(2)
            b[0] = Integer.valueOf(hightPos).toByte()
            b[1] = Integer.valueOf(lowPos).toByte()
            try {

            } catch (e: UnsupportedEncodingException) {
                e.printStackTrace()
            }

            return str[0]
        }
}
